package model.metrics
{
	import visualization.IDataPoint;
	
	public class Minimum extends Metric
	{
		public function Minimum()
		{
			super();
		}
		
		private var _min:Object;
		override public function startMetric(arr:Array):void{
			if(arr.length != 0){
				this._min = (arr[0] as IDataPoint).getData(this.field);
			}
		}
		
		override public function iterate(item:IDataPoint):void{
			var value:Object = item.getData(this.field);
			if(this._min > value){
				this._min = value;
			}
		}
		
		override public function finishMetric(arr:Array):Object{
			return this._min;
		}
		
	}
}